import request from '@/utils/request'

// 获取-员工列表
export const getEmployeeAPI = params => request.get('/sys/user', { params })

/**
 * @description: 删除员工
 * @param {*} id 员工id
 * @return {*}
 */
export function delEmployeeByIdAPI(id) {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}

// 新增-员工
export function addEmployeeAPI(data) {
  return request({
    method: 'post',
    url: '/sys/user',
    data
  })
}

/**
 * @description: 导入excel
 * @param {*} data
    [{
      	 mobile: 15751786320
      	 timeOfEntry: "2019-03-09T16:00:00.000Z"
     	 username: "测试人员1"
     	 workNumber: 88088,
     	 formOfEmployment: 0,
     	 departmentName: "技术部"
      }
    ]
 * @return {*}
 */
export function importEmployee(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
